Skip to content

Conversation

@kean
Copy link
Contributor

@kean kean commented Nov 27, 2025

Fixes regression introduced in #25023. I should not have trusted AI to write regex.

Notes:

  • Yes, it should probably not use regex in the first place
  • I'm looking into the root cause – why do some dotcom sites not have an icon in some responses while they do in others
Screenshot 2025-11-27 at 12 56 21 PM

Before:

Screenshot 2025-11-27 at 12 53 43 PM

After (making the group actually optional):

Screenshot 2025-11-27 at 12 53 47 PM

@kean kean added this to the 26.5 ❄️ milestone Nov 27, 2025
@kean kean added the Reader label Nov 27, 2025
@kean kean requested a review from jkmassel November 27, 2025 17:59
@dangermattic
Copy link
Collaborator

dangermattic commented Nov 27, 2025

1 Warning
⚠️ This PR is assigned to the milestone 26.5 ❄️. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@kean kean enabled auto-merge (squash) November 27, 2025 17:59
@jkmassel
Copy link
Contributor

WDYT about adding a handful of test cases for this?

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 27, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number29973
VersionPR #25025
Bundle IDorg.wordpress.alpha
Commit396258a
Installation URL4do3uvu533m8o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 27, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number29973
VersionPR #25025
Bundle IDcom.jetpack.alpha
Commit396258a
Installation URL05r6qbt5f4ql8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@kean
Copy link
Contributor Author

kean commented Nov 27, 2025

WDYT about adding a handful of test cases for this?

Good idea. I generated a unit test suite for it.

@sonarqubecloud
Copy link

@kean kean requested a review from crazytonyli November 28, 2025 12:30
let range = NSRange(location: 0, length: html.utf16.count)
if let match = regex?.firstMatch(in: html, options: [], range: range),
let matchRange = Range(match.range(at: 1), in: html),
let faviconURL = URL(string: String(html[matchRange]), relativeTo: siteURL) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't spot any real issue here, but I think the casting between Range and NSRange, String and NSString, and potentially unsafe subscript, could be avoided by using Swift.Regex.

@kean kean merged commit 606661c into release/26.5 Nov 30, 2025
26 of 32 checks passed
@kean kean deleted the fix/icon-missing-some-subscription branch November 30, 2025 21:11
crazytonyli pushed a commit that referenced this pull request Nov 30, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 30, 2025
* Fix regex for apple-touch-icon (#25025)

* Merge release_notes/26.5 into release/26.5 (#25036)

* Update Jetpack release notes

* Update metadata strings

---------

Co-authored-by: Tony Li <[email protected]>

* Update app translations – `Localizable.strings`

* Update Jetpack metadata translations

* Bump version number

---------

Co-authored-by: Alex Grebenyuk <[email protected]>
Co-authored-by: Tony Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants